Socket
Socket
Sign inDemoInstall

jss-nested

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-nested

JSS plugin that enables support for nested selectors


Version published
Maintainers
1
Created

What is jss-nested?

The jss-nested package is a plugin for JSS (JavaScript Style Sheets) that allows you to use nested selectors in your styles. This makes it easier to write and manage complex styles by mimicking the nesting capabilities found in preprocessors like Sass and Less.

What are jss-nested's main functionalities?

Nested Selectors

This feature allows you to nest selectors within a style rule, making it easier to manage styles that depend on parent elements or states like hover.

const styles = {
  button: {
    '&:hover': {
      backgroundColor: 'blue'
    },
    '& .icon': {
      color: 'red'
    }
  }
};

Media Queries

You can nest media queries within your style rules, allowing for responsive design directly within your JSS styles.

const styles = {
  container: {
    width: '100%',
    '@media (min-width: 600px)': {
      width: '50%'
    }
  }
};

Nested Conditional Styles

This feature allows you to apply different styles based on class names or other conditions, making it easier to manage variations of a component.

const styles = {
  button: {
    color: 'black',
    '&.primary': {
      color: 'blue'
    },
    '&.secondary': {
      color: 'green'
    }
  }
};

Other packages similar to jss-nested

Keywords

FAQs

Package last updated on 24 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc